import 'package:flutter/material.dart';
import 'package:cook_dinner/config/include.dart';

class MenuList extends StatelessWidget {
  const MenuList({Key? key, this.text1, this.text2, this.index})
      : super(key: key);

  final String? text1;
  final String? text2;
  final int? index;

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: HYSizeFit.screenWidth,
      child: Stack(
        children: [
          Column(
            children: [
              ClipRRect(
                borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(8.rpx),
                  topRight: Radius.circular(8.rpx),
                ),
                child: Image.asset(
                  'assets/images/meeating.png',
                  width: double.infinity,
                  height: 179.rpx,
                  fit: BoxFit.cover,
                ),
              ),
              Container(
                width: HYSizeFit.screenWidth,
                height: 97.rpx,
                margin: EdgeInsets.only(bottom: 32.rpx),
                padding: EdgeInsets.only(left: 24.rpx, right: 15.rpx),
                decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.only(
                    bottomRight: Radius.circular(8.rpx),
                    bottomLeft: Radius.circular(8.rpx),
                  ),
                ),
                child: Row(
                  children: [
                    Container(
                      width: 51.3.rpx,
                      height: 51.3.rpx,
                      alignment: Alignment.center,
                      margin: EdgeInsets.only(right: 22.rpx),
                      decoration: BoxDecoration(
                        color: const Color(0xffFCC302),
                        borderRadius: BorderRadius.circular(26.rpx),
                      ),
                      child: Text(
                        '$index',
                        style: TextStyle(
                          fontSize: 20.rpx,
                          color: Colors.white,
                        ),
                      ),
                    ),
                    Expanded(
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Text(
                            text1 ?? '',
                            style: TextStyle(
                              fontSize: 12.rpx,
                              color: const Color(0xff808080),
                            ),
                          ),
                          SizedBox(height: 8.rpx),
                          Text(
                            text2 ?? '',
                            style: TextStyle(
                              fontSize: 14.rpx,
                              color: const Color(0xff19140E),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
          Positioned(
            right: 0,
            top: 162.rpx,
            child: Container(
              width: 78.rpx,
              height: 32.rpx,
              padding: EdgeInsets.only(left: 8.rpx),
              decoration: BoxDecoration(
                color: Colors.white.withOpacity(0.8),
                borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(16.rpx),
                  bottomLeft: Radius.circular(16.rpx),
                ),
              ),
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Image.asset(
                    'assets/images/video.png',
                    height: 20.rpx,
                    width: 20.rpx,
                  ),
                  SizedBox(width: 4.rpx),
                  Text(
                    '小贴士',
                    style: TextStyle(
                      color: const Color(0xffFA8303),
                      fontSize: 12.rpx,
                    ),
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
